<?php
/**
 * 老师获取任教信息
 * @author shej E-mail:28708@qq.com
 */
require_once '../../dz_framework/init.php';

$user_id = isset($_REQUEST['user_id'])?$_REQUEST['user_id']:"";

// limit 10 最近的10个课时

$vod_info = DB::fetch_all('select v.id,v.name,h.id hid,h.name hname,h.introduction from '.DB::table('vod')." v left join ".DB::table('vod_hour')." h on v.id=h.v_id where teacher_id='".$user_id."' and v.ctype=1 and h.isdelete =0 order by h.dateline desc limit 10");	

if($vod_info)
{
	echo json_encode($vod_info); exit;
	
}else{
	
	echo json_encode(array('error'=>'no data')); exit;
}